home *** CD-ROM | disk | FTP | other *** search
- unit PageFormU;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TNewPageForm = class(TForm)
- lblWinPlatform: TLabel;
- lblWinVersion: TLabel;
- lblNTServicePack: TLabel;
- procedure FormCreate(Sender: TObject);
- end;
-
- procedure BLRegister;
-
- implementation
-
- uses
- CommonHookU;
-
- {$R *.DFM}
-
- type
- TOSVersionInfoEx = record
- dwOSVersionInfoSize: DWORD;
- dwMajorVersion: DWORD;
- dwMinorVersion: DWORD;
- dwBuildNumber: DWORD;
- dwPlatformId: DWORD;
- szCSDVersion: array[0..127] of WideChar; { Maintenance string for PSS usage }
- wServicePackMajor: Word;
- wServicePackMinor: Word;
- wSuiteMask: Word;
- wProductType: Byte;
- wReserved: Byte;
- end;
-
- procedure TNewPageForm.FormCreate(Sender: TObject);
- var
- OSVI: TOSVersionInfoEx;
- begin
- case Win32Platform of
- VER_PLATFORM_WIN32_NT:
- lblWinPlatform.Caption := 'Microsoft Windows NT';
- VER_PLATFORM_WIN32_WINDOWS:
- if (Win32MajorVersion > 4) or
- ((Win32MajorVersion = 4) and (Win32MinorVersion > 0)) then
- lblWinPlatform.Caption := 'Microsoft Windows 98'
- else
- lblWinPlatform.Caption := 'Microsoft Windows 95';
- VER_PLATFORM_WIN32s:
- lblWinPlatform.Caption := 'Win32S on Windows 3.1';
- end;
- lblWinVersion.Caption := Format('Version %d.%d (Build %d: %s)',
- [Win32MajorVersion, Win32MinorVersion,
- Win32BuildNumber and $FFFF, Win32CSDVersion]);
- // Try calling GetVersionEx using the OSVERSIONINFOEX structure,
- // which is supported on Windows 2000 and later.
- // If that fails, we have no service pack information
- FillChar(OSVI, SizeOf(TOSVersionInfoEx), 0);
- OSVI.dwOSVersionInfoSize := SizeOf(TOSVersionInfoEx);
- if GetVersionEx(POSVersionInfo(@OSVI)^) then
- begin
- lblWinPlatform.Caption := 'Microsoft Windows 2000';
- lblNTServicePack.Caption := Format('Service Pack %d.%d',
- [OSVI.wServicePackMajor,
- OSVI.wServicePackMinor]);
- end
- end;
-
- procedure BLRegister;
- begin
- RegisterPages('Windows &version', [TNewPageForm.Create(nil)])
- end;
-
- end.
-